package com.example.demo4;

import java.util.Random;

public class demo01 {

    public static void main(String[] args) {
//        Random random = new Random();
//        System.out.println(random.nextInt(1000));

        long s = System.currentTimeMillis();
        for (int i = 0; i < 1000000; i++) {
            makeNum(5);
        }
        System.out.println(System.currentTimeMillis() - s);
    }

    public static String makeNum(int num){
        StringBuilder stringBuilder = new StringBuilder();
        for (int i = 0; i < num; i++) {
            stringBuilder.append(9);
        }

        Random random = new Random();
        String numString = String.valueOf(random.nextInt(Integer.valueOf(stringBuilder.toString())));
        stringBuilder.setLength(0);

        for (int i=0;i<num - numString.length(); i++){
            stringBuilder.append("0");
        }
        System.out.println("-----------------------------------------------");
        System.out.println("-----------------------------------------------");
        System.out.println("-----------------------------------------------");
        return stringBuilder + numString;



    }
}

